]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
end-session-dialog: Show default icon if user icon is unset
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 29 Mar 2011 14:32:00 +0000 (16:32 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Apr 2011 20:48:37 +0000 (22:48 +0200)
If the user has not configured a user icon, the logout dialog will
display an empty rectangle. Show a default picture instead.

https://bugzilla.gnome.org/show_bug.cgi?id=646032

js/ui/endSessionDialog.js

index c019e2aaaee1aaa414c825593d2024630c7eba6a..a10b86d0052867015b8136d11c9054888e829a9e 100644 (file)
@@ -366,8 +366,10 @@ EndSessionDialog.prototype = {
 
         if (this._user.is_loaded && !dialogContent.iconName) {
             let iconFile = this._user.get_icon_file();
-
-            this._setIconFromFile(iconFile, dialogContent.iconStyleClass);
+            if (GLib.file_test(iconFile, GLib.FileTest.EXISTS))
+                this._setIconFromFile(iconFile, dialogContent.iconStyleClass);
+            else
+                this._setIconFromName('avatar-default', dialogContent.iconStyleClass);
         } else if (dialogContent.iconName) {
             this._setIconFromName(dialogContent.iconName,
                                   dialogContent.iconStyleClass);